package game.assist.diablo3.data.dao.impl;

import game.assist.diablo3.data.dao.OtherDao;
import game.assist.diablo3.data.vo.EmulatorCategory;
import game.assist.diablo3.data.vo.GameAboutIndr;
import game.assist.diablo3.data.vo.GameStrategy;
import game.assist.diablo3.data.vo.SystemInfo;
import game.assist.diablo3.db.DiabloDatabaseHelper;

import java.sql.SQLException;
import java.util.ArrayList;

import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
import com.j256.ormlite.dao.Dao;

public class OtherDAOImpl implements OtherDao {

	private OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity;

	public OtherDAOImpl(OrmLiteBaseActivity<DiabloDatabaseHelper> ormLiteBaseActivity) {
		super();
		this.ormLiteBaseActivity = ormLiteBaseActivity;
	}

	@Override
	public ArrayList<EmulatorCategory> queryAllEmulatorCategory() throws SQLException {
		Dao<EmulatorCategory, Integer> emulatorCategoryDao = ormLiteBaseActivity.getHelper().getEmulatorCategoryDao();
		ArrayList<EmulatorCategory> emulatorList = (ArrayList<EmulatorCategory>) emulatorCategoryDao.queryForAll();
		return emulatorList;
	}

	@Override
	public ArrayList<GameAboutIndr> queryAllGameAboutIndr() throws SQLException {
		Dao<GameAboutIndr, Integer> gameAboutIndrDao = ormLiteBaseActivity.getHelper().getGameAboutIndrDao();
		ArrayList<GameAboutIndr> gameIndrList = (ArrayList<GameAboutIndr>) gameAboutIndrDao.queryForAll();
		return gameIndrList;
	}

	@Override
	public ArrayList<SystemInfo> queryAllGameSystemInfo() throws SQLException {
		Dao<SystemInfo, Integer> gameSystemInfoDao = ormLiteBaseActivity.getHelper().getGameSystemInfoDao();
		ArrayList<SystemInfo> gameSystemInfoList = (ArrayList<SystemInfo>) gameSystemInfoDao.queryForAll();
		return gameSystemInfoList;
	}

	@Override
	public ArrayList<GameStrategy> queryAllGameStrategyInfo() throws SQLException {
		Dao<GameStrategy, Integer> gameStrategyInfoDao = ormLiteBaseActivity.getHelper().getGameStrategyInfoDao();
		ArrayList<GameStrategy> gameSystemInfoList = (ArrayList<GameStrategy>) gameStrategyInfoDao.queryForAll();
		return gameSystemInfoList;
	}

}
